\(\int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx\) [219]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 45, antiderivative size = 34 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=-\frac {a^3 B c^3 \cos ^7(e+f x) (c+c \sin (e+f x))^{-3+n}}{f} \]

[Out]

-a^3*B*c^3*cos(f*x+e)^7*(c+c*sin(f*x+e))^(-3+n)/f

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.044, Rules used = {3046, 2933} \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=-\frac {a^3 B c^3 \cos ^7(e+f x) (c \sin (e+f x)+c)^{n-3}}{f} \]

[In]

Int[(a - a*Sin[e + f*x])^3*(c + c*Sin[e + f*x])^n*(B*(3 - n) + B*(4 + n)*Sin[e + f*x]),x]

[Out]

-((a^3*B*c^3*Cos[e + f*x]^7*(c + c*Sin[e + f*x])^(-3 + n))/f)

Rule 2933

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(f*g*(m + p + 1))), x
] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[a^2 - b^2, 0] && EqQ[a*d*m + b*c*(m + p + 1), 0]

Rule 3046

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a^m*c^m, Int[Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m)*(A + B
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && I
ntegerQ[m] &&  !(IntegerQ[n] && ((LtQ[m, 0] && GtQ[n, 0]) || LtQ[0, n, m] || LtQ[m, n, 0]))

Rubi steps \begin{align*} \text {integral}& = \left (a^3 c^3\right ) \int \cos ^6(e+f x) (c+c \sin (e+f x))^{-3+n} (B (3-n)+B (4+n) \sin (e+f x)) \, dx \\ & = -\frac {a^3 B c^3 \cos ^7(e+f x) (c+c \sin (e+f x))^{-3+n}}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 7.36 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.97 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=-\frac {a^3 B \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^7 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) (c (1+\sin (e+f x)))^n}{f} \]

[In]

Integrate[(a - a*Sin[e + f*x])^3*(c + c*Sin[e + f*x])^n*(B*(3 - n) + B*(4 + n)*Sin[e + f*x]),x]

[Out]

-((a^3*B*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^7*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(c*(1 + Sin[e + f*x]))^
n)/f)

Maple [A] (verified)

Time = 13.16 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.82

method result size
parallelrisch \(-\frac {a^{3} B \left (c \left (1+\sin \left (f x +e \right )\right )\right )^{n} \left (14 \cos \left (f x +e \right )-6 \cos \left (3 f x +3 e \right )+\sin \left (4 f x +4 e \right )-14 \sin \left (2 f x +2 e \right )\right )}{8 f}\) \(62\)

[In]

int((a-a*sin(f*x+e))^3*(c+c*sin(f*x+e))^n*(B*(3-n)+B*(4+n)*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

-1/8*a^3*B*(c*(1+sin(f*x+e)))^n*(14*cos(f*x+e)-6*cos(3*f*x+3*e)+sin(4*f*x+4*e)-14*sin(2*f*x+2*e))/f

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 77 vs. \(2 (34) = 68\).

Time = 0.26 (sec) , antiderivative size = 77, normalized size of antiderivative = 2.26 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=\frac {{\left (3 \, B a^{3} \cos \left (f x + e\right )^{3} - 4 \, B a^{3} \cos \left (f x + e\right ) - {\left (B a^{3} \cos \left (f x + e\right )^{3} - 4 \, B a^{3} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} {\left (c \sin \left (f x + e\right ) + c\right )}^{n}}{f} \]

[In]

integrate((a-a*sin(f*x+e))^3*(c+c*sin(f*x+e))^n*(B*(3-n)+B*(4+n)*sin(f*x+e)),x, algorithm="fricas")

[Out]

(3*B*a^3*cos(f*x + e)^3 - 4*B*a^3*cos(f*x + e) - (B*a^3*cos(f*x + e)^3 - 4*B*a^3*cos(f*x + e))*sin(f*x + e))*(
c*sin(f*x + e) + c)^n/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 898 vs. \(2 (32) = 64\).

Time = 65.37 (sec) , antiderivative size = 898, normalized size of antiderivative = 26.41 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=\text {Too large to display} \]

[In]

integrate((a-a*sin(f*x+e))**3*(c+c*sin(f*x+e))**n*(B*(3-n)+B*(4+n)*sin(f*x+e)),x)

[Out]

Piecewise((B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)**8/(f*tan(e/2 + f*x
/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) - 6*B*a**3*(c + 2*c*
tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)**7/(f*tan(e/2 + f*x/2)**8 + 4*f*tan(e/2 + f*x/
2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) + 14*B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan(e/2
+ f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)**6/(f*tan(e/2 + f*x/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*x/
2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) - 14*B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n*tan(e
/2 + f*x/2)**5/(f*tan(e/2 + f*x/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/
2)**2 + f) + 14*B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)**3/(f*tan(e/2
+ f*x/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) - 14*B*a**3*(c
+ 2*c*tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)**2/(f*tan(e/2 + f*x/2)**8 + 4*f*tan(e/2
+ f*x/2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) + 6*B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan
(e/2 + f*x/2)**2 + 1))**n*tan(e/2 + f*x/2)/(f*tan(e/2 + f*x/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*
x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f) - B*a**3*(c + 2*c*tan(e/2 + f*x/2)/(tan(e/2 + f*x/2)**2 + 1))**n/(f*tan
(e/2 + f*x/2)**8 + 4*f*tan(e/2 + f*x/2)**6 + 6*f*tan(e/2 + f*x/2)**4 + 4*f*tan(e/2 + f*x/2)**2 + f), Ne(f, 0))
, (x*(B*(3 - n) + B*(n + 4)*sin(e))*(-a*sin(e) + a)**3*(c*sin(e) + c)**n, True))

Maxima [F]

\[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=\int { -{\left (B {\left (n + 4\right )} \sin \left (f x + e\right ) - B {\left (n - 3\right )}\right )} {\left (a \sin \left (f x + e\right ) - a\right )}^{3} {\left (c \sin \left (f x + e\right ) + c\right )}^{n} \,d x } \]

[In]

integrate((a-a*sin(f*x+e))^3*(c+c*sin(f*x+e))^n*(B*(3-n)+B*(4+n)*sin(f*x+e)),x, algorithm="maxima")

[Out]

-integrate((B*(n + 4)*sin(f*x + e) - B*(n - 3))*(a*sin(f*x + e) - a)^3*(c*sin(f*x + e) + c)^n, x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 9587 vs. \(2 (34) = 68\).

Time = 48.82 (sec) , antiderivative size = 9587, normalized size of antiderivative = 281.97 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=\text {Too large to display} \]

[In]

integrate((a-a*sin(f*x+e))^3*(c+c*sin(f*x+e))^n*(B*(3-n)+B*(4+n)*sin(f*x+e)),x, algorithm="giac")

[Out]

-(B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x +
e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)
+ 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1
/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*ta
n(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e
)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(-1/4*pi*n*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3
 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f
*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan
(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e
)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2
*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) -
 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/2) - 1/4*pi*n*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 +
 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)))^2*tan(1/2*f*x + 1/2*e)^8 - 6*B*a^3*(sqrt(2*ta
n(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x +
 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2
*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4
+ 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)
^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x
+ 1/2*e)^2 + 1))^n*tan(-1/4*pi*n*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x
 + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4
*pi*n*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan(1/2*f*x + 1/2*e)^
4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*
f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + 1
/4*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f
*x + 1/2*e)) + 1/2) - 1/4*pi*n*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x +
 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)))^2*tan(1/2*f*x + 1/2*e)^7 + 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(
1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan
(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/
2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^
2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*
x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^
n*tan(-1/4*pi*n*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*
sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2
*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f
*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 +
4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/
2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/
2) - 1/4*pi*n*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi
*n*sgn(tan(1/2*f*x + 1/2*e)))^2*tan(1/2*f*x + 1/2*e)^6 - B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 +
 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*
f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x +
 e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*
e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(
c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*
e)^8 - 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*ta
n(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x +
 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2
 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^
2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan
(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(-1/4*pi*n*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x +
1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*t
an(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn
(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x
 + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn
(tan(1/2*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1
/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/2) - 1/4*pi*n*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/
2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)))^2*tan(1/2*f*x + 1/2*e)^5 + 6*B*a^3*(s
qrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1
/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*
x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1
/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x
+ 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(
1/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e)^7 - 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4
*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*
x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e
)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)
 + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)
/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e)
^6 + 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(
f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1
/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 +
 tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3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(1/
2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x
 + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/
2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x +
 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1
/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e)^5 - 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*
tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x
 + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)
^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)
+ 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/
(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(-1/4*pi*n*sgn(2*c
*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1
/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sg
n(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan
(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e
)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*
tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/2) - 1/4*pi*n*sgn(4*c*t
an(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/
2*e)))^2*tan(1/2*f*x + 1/2*e)^2 + 6*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan
(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*ta
n(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e
)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*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x + e)^4*tan(1/2*f*x + 1/2*e)^3
 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/
2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1
/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*
x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^
2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e)^3 - B*a^3*(sqrt(2*tan(f*x + e)^4*tan(
1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan
(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/
2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^
2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*
x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^
n*tan(-1/4*pi*n*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*
sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2
*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f
*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 +
4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/
2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/
2) - 1/4*pi*n*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi
*n*sgn(tan(1/2*f*x + 1/2*e)))^2 + 14*B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*ta
n(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*t
an(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x +
e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x +
 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*t
an(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e)^2 - 6*B*a^3*(sqrt
(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*
f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x +
 e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*
e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1
/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2
*f*x + 1/2*e)^2 + 1))^n*tan(1/2*f*x + 1/2*e) + B*a^3*(sqrt(2*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^4 + 4*tan(f*x
 + e)^4*tan(1/2*f*x + 1/2*e)^3 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e)^2 + 3*tan(f*x + e)^2*tan(1/2*f*x + 1/2*
e)^4 + 4*tan(f*x + e)^4*tan(1/2*f*x + 1/2*e) + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^3 + 2*tan(f*x + e)^4 + 6*
tan(f*x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(1/2*f*x + 1/2*e)^4 + 8*tan(f*x + e)^2*tan(1/2*f*x + 1/2*e) + 4*tan
(1/2*f*x + 1/2*e)^3 + 3*tan(f*x + e)^2 + 2*tan(1/2*f*x + 1/2*e)^2 + 4*tan(1/2*f*x + 1/2*e) + 1)*abs(c)/(tan(f*
x + e)^2*tan(1/2*f*x + 1/2*e)^2 + tan(f*x + e)^2 + tan(1/2*f*x + 1/2*e)^2 + 1))^n)/(f*tan(-1/4*pi*n*sgn(2*c*ta
n(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*
e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(t
an(1/2*f*x + 1/2*e)) + pi*n*floor(1/4*sgn(2*c*tan(1/2*f*x + 1/2*e)^4 + 4*c*tan(1/2*f*x + 1/2*e)^3 - 4*c*tan(1/
2*f*x + 1/2*e) - 2*c)*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e))
- 1/4*sgn(tan(1/2*f*x + 1/2*e)^2 - 1)*sgn(tan(1/2*f*x + 1/2*e)) + 1/4*sgn(4*c*tan(1/2*f*x + 1/2*e)^3 + 8*c*tan
(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) - 1/4*sgn(tan(1/2*f*x + 1/2*e)) + 1/2) - 1/4*pi*n*sgn(4*c*tan(
1/2*f*x + 1/2*e)^3 + 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e
)))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+ 8*c*tan(1/2*f*x + 1/2*e)^2 + 4*c*tan(1/2*f*x + 1/2*e)) + 1/4*pi*n*sgn(tan(1/2*f*x + 1/2*e)))^2 + 4*f
*tan(1/2*f*x + 1/2*e)^2 + f)

Mupad [B] (verification not implemented)

Time = 13.98 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.79 \[ \int (a-a \sin (e+f x))^3 (c+c \sin (e+f x))^n (B (3-n)+B (4+n) \sin (e+f x)) \, dx=-\frac {B\,a^3\,{\left (c\,\left (\sin \left (e+f\,x\right )+1\right )\right )}^n\,\left (14\,\cos \left (e+f\,x\right )-6\,\cos \left (3\,e+3\,f\,x\right )-14\,\sin \left (2\,e+2\,f\,x\right )+\sin \left (4\,e+4\,f\,x\right )\right )}{8\,f} \]

[In]

int(-(B*(n - 3) - B*sin(e + f*x)*(n + 4))*(a - a*sin(e + f*x))^3*(c + c*sin(e + f*x))^n,x)

[Out]

-(B*a^3*(c*(sin(e + f*x) + 1))^n*(14*cos(e + f*x) - 6*cos(3*e + 3*f*x) - 14*sin(2*e + 2*f*x) + sin(4*e + 4*f*x
)))/(8*f)